package com.own.component.mybatis.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.own.component.mybatis.base.BaseMybatisPlusConfig;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * MyBatisPlusConfig
 *
 * @author chenxueli
 * @date 2020/8/27 13:40
 */
@EnableTransactionManagement
@SpringBootConfiguration
@ConditionalOnMissingBean(MybatisPlusInterceptor.class)
public class MyBatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        return BaseMybatisPlusConfig.init();
    }

}
